﻿using System;
using System.Data;

namespace DotNetNuke.Modules.Help.Tests.Mocks
{
    public static class MockHelper
    {
        public const int ModuleId = 321;
        public const int CategoryModuleId = 323;
        public const int ModuleIdFail = 1;
        public const int ValidHelpInfoId = 1;
        public const int NullHelpInfoId = 0;
        public const int LoadExceptionId = -2;
        public const int AddExceptionId = -3;
        public const int UpdateExceptionId = -4;
        public const int DeleteExceptionId = -5;

        public const string createdByUserName = "User 1";
        public const int createdByUser = 1;
        public const int createdDateYear = 2008;
        public const int createdDateMonth = 1;
        public const int createdDateDay = 1;

        public const string categoryTitle = "Category Title";
        public const string categoryDescription = "Description";
        public const int categoryImage = 1;
        public const string categoryKeyWords = "KeyWords";
        public const int categoryViewOrder = 1;
        public const int categoryLevel = 1;
        public const int categoryParent = 1;
        public const bool categoryVisible = true;
        public const string categoryTitleUpdated = "Updated Category Title";
        public const string categoryDescriptionUpdated = "Updated Description";
        public const int categoryImageUpdated = 0;
        public const string categoryKeyWordsUpdated = "Updated KeyWords";
        public const int categoryViewOrderUpdated = 2;
        public const int categoryLevelUpdated = 0;
        public const int categoryParentUpdated = 0;
        public const bool categoryVisibleUpdated = false;

        public const string TutorialGuid = "3fab0812-02c9-47aa-be53-679ecb3b73d7";
        public const string Title = "Title";
        public const string Title2 = "Z Title";
        public const string ProductImage = "ProductImage";
        public const bool Featured = true;
        public const string KeyWords = "KeyWords";
        public const string KeyWords2 = "Z KeyWords";
        public const string DownloadName = "DownloadName";
        public const string ShortDesc = "ShortDesc";
        public const string ShortDesc2 = "Z ShortDesc";
        public const bool Archive = true;
        public const string Description = "Description";
        public const string Description2 = "Z Description";
        public const string TitleUpdated = "Title Updated";
        public const string ProductImageUpdated = "Product Image Updated";
        public const bool FeaturedUpdated = false;
        public const string KeyWordsUpdated = "Key Words Updated";
        public const string DownloadNameUpdated = "DownloadName Updated";
        public const string ShortDescUpdated = "Short Desc Updated";
        public const bool ArchiveUpdated = false;
        public const string DescriptionUpdated = "DescriptionUpdated";

        public const string CategoryList = "<Categorys><id>1</id><id>2</id></Categorys>";
        public const string CategoryListNonExistent = "<Categorys><id>10</id><id>20</id></Categorys>";


        public static HelpTutorialInfo CreateHelpTutorialInfo()
        {
            HelpTutorialInfo helpTutorialInfo = new HelpTutorialInfo();
            helpTutorialInfo.ItemId = ValidHelpInfoId;
            helpTutorialInfo.CreatedByUserName = createdByUserName;
            helpTutorialInfo.CreatedDate = new DateTime(createdDateYear, createdDateMonth, createdDateDay); ;
            return helpTutorialInfo;
        }

        public static IDataReader CreateHelpTutorialDataReader()
        {
            DataTable datatable = new DataTable();
            datatable.Columns.Add("ModuleId");
            datatable.Columns.Add("ItemId");
            datatable.Columns.Add("Content");
            datatable.Columns.Add("CreatedByUser");
            datatable.Columns.Add("CreatedDate");
            datatable.Columns.Add("CreatedByUserName");

            //datatable.Rows.Add(ModuleId, ValidHelpInfoId, content, createdByUser, new DateTime(createdDateYear, createdDateMonth, createdDateDay), createdByUserName);

            return datatable.CreateDataReader();

        }

        public static IDataReader CreateHelpTutorialDataReader2Rows()
        {
            DataTable datatable = new DataTable();
            datatable.Columns.Add("ModuleId");
            datatable.Columns.Add("ItemId");
            datatable.Columns.Add("Content");
            datatable.Columns.Add("CreatedByUser");
            datatable.Columns.Add("CreatedDate");
            datatable.Columns.Add("CreatedByUserName");

            //datatable.Rows.Add(ModuleId, ValidHelpInfoId, content, createdByUser, new DateTime(createdDateYear, createdDateMonth, createdDateDay), createdByUserName);
            //datatable.Rows.Add(ModuleId, ValidHelpInfoId, content, createdByUser, new DateTime(createdDateYear, createdDateMonth, createdDateDay), createdByUserName);

            return datatable.CreateDataReader();

        }

    }
}
